<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: zhanzhongxin
  Date: 2021/8/5
  Time: 14:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.xxx.pojo.Student" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    final ArrayList<Student> list = new ArrayList<>();
    list.add(new Student("张三", 20));
    list.add(new Student("李四", 30));
    list.add(new Student("王五", 50));
    list.add(new Student("赵六", 60));
    request.setAttribute("list", list);
%>
<table>
    <tr>
        <th>姓名</th>
        <th>年龄</th>
    </tr>
    <c:forEach var="stu" items="${list}" varStatus="vs">
        <tr>
            <td>${stu.name}</td>
            <td>${stu.age}</td>
            <td>${vs.first}</td>
            <td>${vs.last}</td>
            <td>${vs.count}</td>
            <td>${vs.current}</td>
            <td>${vs.index}</td>
        </tr>
    </c:forEach>

    <c:forEach var="i" begin="1" end="10" step="1">
        <h1>${i}</h1>
    </c:forEach>
    <hr/>
    <c:forEach var="i" begin="1" end="10" step="2">
        <h1>${i}</h1>
    </c:forEach>
</table>
</body>
</html>
